package cn.felord.current;

/**
 * @author Dax
 * @since 14:12  2018/7/17
 */
public class MyThread extends Thread {


    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {

        while (true) {
            if(this.isInterrupted()){
                System.out.println(" RUN is isInterrupted");
                try {
                    System.out.println("eeeee " + this.isInterrupted());
                    Thread.sleep(1000);

                    System.out.println("ccccc " + this.isInterrupted());

                    System.out.println(Thread.currentThread().getName() + " (" + this.getState() + ") loop ");

                } catch (InterruptedException e) {
                    System.out.println("ddddd " + this.isInterrupted());

                    System.out.println(Thread.currentThread().getName() + " (" + this.getState() + ") catch InterruptedException.");
                }
            }

//http://www.cnblogs.com/w-wfy/p/6415005.html

        }
    }

}
